<?php

require_once("Downloader.class.php");
require_once("nl2br_filter.class.php");
stream_filter_register("nl2br", "nl2br_filter")
   or die("Failed to register filter");

$urls = array("http://www.google.ru/search?as_q=php&hl=ru&newwindow=1&num=100&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&as_sitesearch=&as_rights=&safe=images");
$down = new Downloader();
$down->AddLogEngine("downloader.log");
try
{
   $data = $down->DownloadToArray($urls);
   $cont = $data[0];
   preg_match_all("|<a\s+href\s*=\s*['\"](http://[^'\"]+)['\"][^>]*>|iU", $cont["contents"], $match);
   $down->ToLog("Found ".count($match[1])." URLs.");
   /*$cont = */$down->DownloadToArray($match[1]);
}
catch (Exception $ex)
{
   $down->ToLog($ex);
}

?>